package com.zyong.design.pattern.command.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: ClothesHangerOffCommand
 * @author: zyong
 * @create: 2024-03-27 22:14
 */
public class ClothesHangerOffCommand implements Command {
    private ClothesHangerReceiver clothesHangerReceiver;

    public ClothesHangerOffCommand(ClothesHangerReceiver clothesHangerReceiver) {
        this.clothesHangerReceiver = clothesHangerReceiver;
    }

    @Override
    public void execute() {
        clothesHangerReceiver.off();
    }

    @Override
    public void undo() {
        clothesHangerReceiver.on();
    }
}
